package com.jinsi.controller;

import com.jinsi.pojo.Supplier;
import com.jinsi.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/supplier")
public class SupplierController {


    @Autowired
    private SupplierService supplierService;

    @RequestMapping("getAll")
    public Map<String,Object> getAll(){

        List<Supplier> all = supplierService.getAll();
        Map<String,Object> map = new HashMap<>();
        map.put("suppliers",all);

        return map;
    }
}
